#include <cstdio>
int main()
{
    int a,b,c;
    char d[3]={0},e[3]={0},f[3]={0};
    scanf("%d%d%d",&a,&b,&c);
    char map[14]={"0123456789ABC"};
    d[1]=map[a%13];d[0]=map[a/13];
    e[1]=map[b%13];e[0]=map[b/13];
    f[1]=map[c%13];f[0]=map[c/13];
    printf("#%s%s%s",d,e,f);
    return 0;
}
